# -*-encoding: Utf-8 -*-
# author: 黄景涛
# Time：2025/3/11

from 自定义迭代器类 import AutoIterator

if __name__ == '__main__':
    n = 5
    counter = AutoIterator(1, n)
    for _ in range(n-1):
        print(next(counter))    # 内置函数next，调用迭代器实例的__next__方法； 获得其返回值

    counter2 = iter(counter)    # 内饰函数iter，调用迭代器实例的__iter__方法； 获得self本身
    print(f"当前实例的属性值：{counter.current}")
    for _ in range(n-1):
        print(next(counter2))